<template>
  <div>Foo</div>
</template>

<script>
export default {
  // 组件路由解析前 -- 在路由独享守卫之后触发
  beforeRouteEnter(to, from, next) {
    console.log("foo::beforeRouteEnter");
    next();
  },

  // 组件路由更改时解析
  beforeRouteUpdate(to, from, next) {
    console.log("foo::beforeRouteUpdate");
    next();
  },

  // 组件路由离开时解析
  beforeRouteLeave(to, from, next) {
    console.log("foo::beforeRouteLeave");
    next();
  }
};
</script>